﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DynaPrecision.Financial
{
	public class MemorylessTimeStepHolder : ITimeStepHolder
	{
		public int DataSize { get; set; }
		public void Initiate()
		{
			_currentTimeStep = DynaPrecision.ListGenerator.ConstantValueList<double>(0, DataSize).ToList();
			_nextTimeStep = DynaPrecision.ListGenerator.ConstantValueList<double>(0, DataSize).ToList();
		}
		protected List<double> _currentTimeStep;
		protected List<double> _nextTimeStep;
		public void Advance()
		{
			for (int i = 0; i < _currentTimeStep.Count; i++)
			{
				this._currentTimeStep[i] = this._nextTimeStep[i];
			}
		}

		public IList<double> CurrentTimeStep
		{
			get
			{
				return _currentTimeStep;
			}
		}

		public IList<double> NextTimeStep
		{
			get
			{
				return _nextTimeStep;
			}
		}
	}
}